/*
 * deviceio.wsdl web service operations
 *  depend on: devicemgmt.wsdl media.wsdl
 * implemention
 *
 */
#include "../soapH.h"
#include "../onvif.h"
#include "deviceio_service.h"

int get_deviceioservice_cap(struct soap *soap, struct tmd__Capabilities * deviceio)
{
	if(soap == NULL || deviceio == NULL)
	{
		DBG("invalid params.\n");
		return -1;
	}
	deviceio->__size = 0;
	deviceio->__any = NULL;
	deviceio->__anyAttribute = NULL;
	deviceio->VideoSources = deviceio_caps[IO_CAP_VS];
	deviceio->VideoOutputs = deviceio_caps[IO_CAP_VO];
	deviceio->AudioSources = deviceio_caps[IO_CAP_AS];
	deviceio->AudioOutputs = deviceio_caps[IO_CAP_AO];
	deviceio->RelayOutputs = deviceio_caps[IO_CAP_RO];
	return 0;
}
static int get_videosource(struct soap *soap, const char *token, int seq, struct tt__VideoSource *vs)
{
	if((token == NULL && seq < 0)|| vs == NULL)
	{
		DBG("param is invalid.\n");
		return -1;
	}
	//to implementing ...
	int id = 0;
	int total = deviceio_caps[IO_CAP_VS];
	if(token)
	{
		int i = 0;
		for(; i < total; i++)
		{
			if(!strcmp(token,io_vsource[i][IO_VS_TOKEN]))
			{
				id = i;
				break;
			}
		}
		if(i == total)
		{
			DBG("video source token:%s is invalid.\n",token);
			// fill soap fault code.
			return -1;
		}
	}
	else
		id = seq;

	vs->token = (char *)soap_malloc(soap, sizeof(char)*TOKEN_LEN);
	strcpy(vs->token,io_vsource[id][IO_VS_TOKEN]); //注意这里需要和GetProfile中的sourcetoken相同
	sscanf(io_vsource[id][IO_VS_FRATE],"%f",&vs->Framerate);

	vs->Resolution = (struct tt__VideoResolution *)soap_malloc(soap, sizeof(struct tt__VideoResolution));
	sscanf(io_vsource[id][IO_VS_RESOL], "%d;%d", &vs->Resolution->Width,&vs->Resolution->Height);	

	vs->Imaging =(struct tt__ImagingSettings*)soap_malloc(soap, sizeof(struct tt__ImagingSettings));
	vs->Imaging->BacklightCompensation = (struct tt__BacklightCompensation*)soap_malloc(soap, sizeof(struct tt__BacklightCompensation));
	vs->Imaging->Brightness = (float*)soap_malloc(soap,sizeof(float));
	vs->Imaging->ColorSaturation = (float*)soap_malloc(soap,sizeof(float));
	vs->Imaging->Contrast = (float*)soap_malloc(soap,sizeof(float));
	vs->Imaging->Exposure = NULL; // must set to null
	vs->Imaging->Focus = NULL;// must set to null
	vs->Imaging->IrCutFilter = (enum tt__IrCutFilterMode *)soap_malloc(soap,sizeof(enum tt__IrCutFilterMode));
	vs->Imaging->Sharpness = (float*)soap_malloc(soap,sizeof(float));
	vs->Imaging->WideDynamicRange = (struct tt__WideDynamicRange*)soap_malloc(soap, sizeof(struct tt__WideDynamicRange));
	vs->Imaging->WhiteBalance = (struct tt__WhiteBalance*)soap_malloc(soap, sizeof(struct tt__WhiteBalance));
	vs->Imaging->WhiteBalance->__any = NULL; 
	vs->Imaging->Extension = NULL;
	//DBG("sscanf imaging settings...\n");
	sscanf(io_vsource[id][IO_VS_IMAGE],"%d,%f;%f;%f;%f;%*d;%*d;%d;%f;%d,%f;%d,%f,%f,%d;",
			&vs->Imaging->BacklightCompensation->Mode,&vs->Imaging->BacklightCompensation->Level,
			vs->Imaging->Brightness,vs->Imaging->ColorSaturation,vs->Imaging->Contrast,
			vs->Imaging->IrCutFilter,vs->Imaging->Sharpness,
			&vs->Imaging->WideDynamicRange->Mode,&vs->Imaging->WideDynamicRange->Level,
			&vs->Imaging->WhiteBalance->Mode,&vs->Imaging->WhiteBalance->CrGain,
			&vs->Imaging->WhiteBalance->CbGain,&vs->Imaging->WhiteBalance->__size);
	//DBG("sscanf imaging settings end.\n");
#if 0
	int count1 = 0;
	int count2 = 0;
	sscanf(io_vsource[id][IO_VS_IMAGE],"%d,%f;%f;%f;%f;%n",
			&vs->Imaging->BacklightCompensation->Mode,&vs->Imaging->BacklightCompensation->Level,
			vs->Imaging->Brightness,vs->Imaging->ColorSaturation,vs->Imaging->Contrast,&count1);

	sscanf(io_vsource[id][IO_VS_IMAGE]+count1,"%*d;%*d;%d;%f;%d,%f;%n",
			vs->Imaging->IrCutFilter,vs->Imaging->Sharpness,
			&vs->Imaging->WideDynamicRange->Mode,&vs->Imaging->WideDynamicRange->Level,&count2);

	sscanf(io_vsource[id][IO_VS_IMAGE]+count1+count2,"%d,%f,%f,%d;",
			&vs->Imaging->WhiteBalance->Mode,&vs->Imaging->WhiteBalance->CrGain,
			&vs->Imaging->WhiteBalance->CbGain,&vs->Imaging->WhiteBalance->__size);
#endif
	vs->Extension = NULL;	
	vs->__anyAttribute = NULL;
	
	return 0;
}

int get_vo_layout(struct soap *soap, struct tt__Layout *layout,int id)
{
	if(soap == NULL || layout == NULL || id < 0 || id >= IO_VO_MAX_POS)
	{
		DBG("invalid params!\n");
		return -1;
	}

	char pane_layout[512];
	char * p = pane_layout;
	bzero(pane_layout,512);

	int size = 0; 
	int cnt = 0;
	int i;
	sscanf(io_voutput[id][IO_VO_LAYOUT],"%d;%n", &size, &cnt);
	layout->__sizePaneLayout = size;
	if(size > 0)
	{
		strcpy(pane_layout, io_voutput[id][IO_VO_LAYOUT]+cnt);
		layout->PaneLayout = (struct tt__PaneLayout*)soap_malloc(soap, sizeof(struct tt__PaneLayout)*size);
		cnt = 0;
		for(i=0;i<size;i++)
		{
			p += cnt;
			layout->PaneLayout[i].Pane = (char*)soap_malloc(soap,sizeof(char)*TOKEN_LEN);
			layout->PaneLayout[i].Area = (struct tt__Rectangle *)soap_malloc(soap,sizeof(struct tt__Rectangle));
			layout->PaneLayout[i].__size = 0;
			layout->PaneLayout[i].__any = NULL;
			layout->PaneLayout[i].__anyAttribute = NULL;
			layout->PaneLayout[i].Area->bottom = (float*)soap_malloc(soap,sizeof(float));
			layout->PaneLayout[i].Area->top = (float*)soap_malloc(soap,sizeof(float));
			layout->PaneLayout[i].Area->right = (float*)soap_malloc(soap,sizeof(float));
			layout->PaneLayout[i].Area->left = (float*)soap_malloc(soap,sizeof(float));

			sscanf(p,"%s,%f,%f,%f,%f;%n",layout->PaneLayout[i].Pane,layout->PaneLayout[i].Area->bottom,
					layout->PaneLayout[i].Area->top,layout->PaneLayout[i].Area->right,
					layout->PaneLayout[i].Area->left, &cnt);
		}
	}
	else
	{
		layout->PaneLayout = NULL;
	}
	layout->Extension = NULL;
	layout->__anyAttribute = NULL;

	return 0;
}
//====================================================================================================//
/** Auto-test server operation __tmd__GetServiceCapabilities */
int __tmd__GetServiceCapabilities(struct soap *soap, struct _tmd__GetServiceCapabilities *tmd__GetServiceCapabilities, struct _tmd__GetServiceCapabilitiesResponse *tmd__GetServiceCapabilitiesResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	tmd__GetServiceCapabilitiesResponse->Capabilities = (struct tmd__Capabilities *)soap_malloc(soap, sizeof(struct tmd__Capabilities));
	get_deviceioservice_cap(soap, tmd__GetServiceCapabilitiesResponse->Capabilities);
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetAudioSources */
int __tmd__GetAudioSources(struct soap *soap, struct _trt__GetAudioSources *trt__GetAudioSources, struct _trt__GetAudioSourcesResponse *trt__GetAudioSourcesResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	int size = deviceio_caps[IO_CAP_AS];
	trt__GetAudioSourcesResponse->__sizeAudioSources = size;
	trt__GetAudioSourcesResponse->AudioSources = (struct tt__AudioSource *)soap_malloc(soap, sizeof(struct tt__AudioSource)*size);
	int i;
	struct tt__AudioSource * p = trt__GetAudioSourcesResponse->AudioSources;
	for(i = 0; i < size&&p; i++)
	{
		p[i].Channels = atoi(io_asource[i][IO_AS_CHN]); //1: mono, 2: stereo
		p[i].token = (char*)soap_malloc(soap, sizeof(char)*TOKEN_LEN);
		strcpy(p[i].token, io_asource[i][IO_AS_TOKEN]);
		p[i].__size = 0;
		p[i].__any = NULL;
		p[i].__anyAttribute = NULL;
	}
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetAudioOutputs */
int __tmd__GetAudioOutputs(struct soap *soap, struct _trt__GetAudioOutputs *trt__GetAudioOutputs, struct _trt__GetAudioOutputsResponse *trt__GetAudioOutputsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	int size = deviceio_caps[IO_CAP_AO];
	trt__GetAudioOutputsResponse->__sizeAudioOutputs = size;
	trt__GetAudioOutputsResponse->AudioOutputs = (struct tt__AudioOutput *)soap_malloc(soap, sizeof(struct tt__AudioOutput)*size);
	int i;
	struct tt__AudioOutput *p = trt__GetAudioOutputsResponse->AudioOutputs;
	for(i = 0; i < size&&p; i++)
	{
		p[i].token = (char*)soap_malloc(soap, sizeof(char)*TOKEN_LEN);
		strcpy(p[i].token, io_aoutput[i][IO_AO_TOKEN]);
		p[i].__size = 0;
		p[i].__any = NULL;
		p[i].__anyAttribute = NULL;
	}
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetVideoSources */
int __tmd__GetVideoSources(struct soap *soap, struct _trt__GetVideoSources *trt__GetVideoSources, struct _trt__GetVideoSourcesResponse *trt__GetVideoSourcesResponse)
{	
	/* Return incomplete response with default data values */
	DBG("__tmd__GetVideoSources\n");
	int size,i;
	size = deviceio_caps[IO_CAP_VS];
	trt__GetVideoSourcesResponse->__sizeVideoSources = size;
	trt__GetVideoSourcesResponse->VideoSources = (struct tt__VideoSource *)soap_malloc(soap, sizeof(struct tt__VideoSource) * size);
	for(i = 0; i < size; i++)
	{
		get_videosource(soap,NULL, i, trt__GetVideoSourcesResponse->VideoSources+i);
	}
	DBG("getvideosources end.\n");
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetVideoOutputs */
int __tmd__GetVideoOutputs(struct soap *soap, struct _tmd__GetVideoOutputs *tmd__GetVideoOutputs, struct _tmd__GetVideoOutputsResponse *tmd__GetVideoOutputsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	int size = deviceio_caps[IO_CAP_VO];
	tmd__GetVideoOutputsResponse->__sizeVideoOutputs = size;
	tmd__GetVideoOutputsResponse->VideoOutputs = (struct tt__VideoOutput *)soap_malloc(soap, sizeof(struct tt__VideoOutput)*size);
	int i;
	struct tt__VideoOutput *p = tmd__GetVideoOutputsResponse->VideoOutputs;
	for(i = 0; i < size&&p;i++)
	{
		p[i].token = (char*)soap_malloc(soap, sizeof(char)*TOKEN_LEN);
		strcpy(p[i].token, io_voutput[i][IO_VO_TOKEN]);
		p[i].Layout = (struct tt__Layout *)soap_malloc(soap, sizeof(struct tt__Layout));
		get_vo_layout(soap, p[i].Layout, i);
		p[i].__size = 0;
		p[i].__any = NULL;
		p[i].__anyAttribute = NULL;
	}
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetVideoSourceConfiguration */
int __tmd__GetVideoSourceConfiguration(struct soap *soap, struct _tmd__GetVideoSourceConfiguration *tmd__GetVideoSourceConfiguration, struct _tmd__GetVideoSourceConfigurationResponse *tmd__GetVideoSourceConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int pos = 0;
	pos = search_vstoken_pos(tmd__GetVideoSourceConfiguration->VideoSourceToken);
	tmd__GetVideoSourceConfigurationResponse->__size = 0;
	tmd__GetVideoSourceConfigurationResponse->__any = NULL;
	if(pos >= 0)
	{
		tmd__GetVideoSourceConfigurationResponse->VideoSourceConfiguration = (struct tt__VideoSourceConfiguration *)soap_malloc(soap, sizeof(struct tt__VideoSourceConfiguration));
		get_videosource_config(soap,pos,tmd__GetVideoSourceConfigurationResponse->VideoSourceConfiguration);
		return SOAP_OK;
	}
	else
	{
		const char *spec_err[] = {"ter:NoConfig",NULL};
		tmd__GetVideoSourceConfigurationResponse->VideoSourceConfiguration = NULL;
		soap_sender_fault_subcode(soap,"ter:InvalidArgVal","Configuration token does not exist",NULL);
		process_specific_fault(soap,spec_err);
		return SOAP_FAULT;
	}
}


/** Auto-test server operation __tmd__GetVideoOutputConfiguration */
int __tmd__GetVideoOutputConfiguration(struct soap *soap, struct _tmd__GetVideoOutputConfiguration *tmd__GetVideoOutputConfiguration, struct _tmd__GetVideoOutputConfigurationResponse *tmd__GetVideoOutputConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int pos = 0;
	pos = search_votoken_pos(tmd__GetVideoOutputConfiguration->VideoOutputToken);
	tmd__GetVideoOutputConfigurationResponse->__size = 0;
	tmd__GetVideoOutputConfigurationResponse->__any = NULL;
	if(pos >=0 )
	{
		tmd__GetVideoOutputConfigurationResponse->VideoOutputConfiguration = (struct tt__VideoOutputConfiguration *)soap_malloc(soap, sizeof(struct tt__VideoOutputConfiguration));
		get_videoutput_config(soap,pos,tmd__GetVideoOutputConfigurationResponse->VideoOutputConfiguration);
		return SOAP_OK;
	}
	else
	{
		tmd__GetVideoOutputConfigurationResponse->VideoOutputConfiguration = NULL;
		return SOAP_FAULT;
	}
}


/** Auto-test server operation __tmd__GetAudioSourceConfiguration */
int __tmd__GetAudioSourceConfiguration(struct soap *soap, struct _tmd__GetAudioSourceConfiguration *tmd__GetAudioSourceConfiguration, struct _tmd__GetAudioSourceConfigurationResponse *tmd__GetAudioSourceConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int pos = 0;
	pos = search_astoken_pos(tmd__GetAudioSourceConfiguration->AudioSourceToken);
	tmd__GetAudioSourceConfigurationResponse->__size = 0;
	tmd__GetAudioSourceConfigurationResponse->__any = NULL;
	if(pos >= 0)
	{
		tmd__GetAudioSourceConfigurationResponse->AudioSourceConfiguration = (struct tt__AudioSourceConfiguration*)soap_malloc(soap,sizeof(struct tt__AudioSourceConfiguration));
		get_audiosource_config(soap,pos,tmd__GetAudioSourceConfigurationResponse->AudioSourceConfiguration);
		return SOAP_OK;
	}
	else
	{
		tmd__GetAudioSourceConfigurationResponse->AudioSourceConfiguration = NULL;
		return SOAP_FAULT;
	}
}


/** Auto-test server operation __tmd__GetAudioOutputConfiguration */
int __tmd__GetAudioOutputConfiguration(struct soap *soap, struct _tmd__GetAudioOutputConfiguration *tmd__GetAudioOutputConfiguration, struct _tmd__GetAudioOutputConfigurationResponse *tmd__GetAudioOutputConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int pos = 0;
	pos = search_aotoken_pos(tmd__GetAudioOutputConfiguration->AudioOutputToken);
	tmd__GetAudioOutputConfigurationResponse->__size = 0;
	tmd__GetAudioOutputConfigurationResponse->__any = NULL;
	if(pos >= 0)
	{
		tmd__GetAudioOutputConfigurationResponse->AudioOutputConfiguration = (struct tt__AudioOutputConfiguration*)soap_malloc(soap, sizeof(struct tt__AudioOutputConfiguration));
		get_audioutput_config(soap,pos,tmd__GetAudioOutputConfigurationResponse->AudioOutputConfiguration);
		return SOAP_OK;
	}
	else
	{
		tmd__GetAudioOutputConfigurationResponse->AudioOutputConfiguration = NULL;
		return SOAP_FAULT;
	}
}


/** Auto-test server operation __tmd__SetVideoSourceConfiguration */
int __tmd__SetVideoSourceConfiguration(struct soap *soap, struct _tmd__SetVideoSourceConfiguration *tmd__SetVideoSourceConfiguration, struct _tmd__SetVideoSourceConfigurationResponse *tmd__SetVideoSourceConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int persis_flag = tmd__SetVideoSourceConfiguration->ForcePersistence;
	DBG("persis_flag = %d\n",persis_flag);

	set_videosource_config(persis_flag, tmd__SetVideoSourceConfiguration->Configuration);

	tmd__SetVideoSourceConfigurationResponse->__size = 0;
	tmd__SetVideoSourceConfigurationResponse->__any = NULL;

	return SOAP_OK;
}


/** Auto-test server operation __tmd__SetVideoOutputConfiguration */
int __tmd__SetVideoOutputConfiguration(struct soap *soap, struct _tmd__SetVideoOutputConfiguration *tmd__SetVideoOutputConfiguration, struct _tmd__SetVideoOutputConfigurationResponse *tmd__SetVideoOutputConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int persis_flag = tmd__SetVideoOutputConfiguration->ForcePersistence;
	DBG("persis_flag = %d\n",persis_flag);

	set_videoutput_config(persis_flag, tmd__SetVideoOutputConfiguration->Configuration);

	tmd__SetVideoOutputConfigurationResponse->__size = 0;
	tmd__SetVideoOutputConfigurationResponse->__any = NULL;

	return SOAP_OK;
}


/** Auto-test server operation __tmd__SetAudioSourceConfiguration */
int __tmd__SetAudioSourceConfiguration(struct soap *soap, struct _tmd__SetAudioSourceConfiguration *tmd__SetAudioSourceConfiguration, struct _tmd__SetAudioSourceConfigurationResponse *tmd__SetAudioSourceConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int persis_flag = tmd__SetAudioSourceConfiguration->ForcePersistence;
	DBG("persis_flag = %d\n",persis_flag);

	set_audiosource_config(persis_flag, tmd__SetAudioSourceConfiguration->Configuration);

	tmd__SetAudioSourceConfigurationResponse->__size = 0;
	tmd__SetAudioSourceConfigurationResponse->__any = NULL;

	return SOAP_OK;
}


/** Auto-test server operation __tmd__SetAudioOutputConfiguration */
int __tmd__SetAudioOutputConfiguration(struct soap *soap, struct _tmd__SetAudioOutputConfiguration *tmd__SetAudioOutputConfiguration, struct _tmd__SetAudioOutputConfigurationResponse *tmd__SetAudioOutputConfigurationResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);

	int persis_flag = tmd__SetAudioOutputConfiguration->ForcePersistence;
	DBG("persis_flag = %d\n",persis_flag);

	set_audioutput_config(persis_flag, tmd__SetAudioOutputConfiguration->Configuration);

	tmd__SetAudioOutputConfigurationResponse->__size = 0;
	tmd__SetAudioOutputConfigurationResponse->__any = NULL;

	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetVideoSourceConfigurationOptions */
int __tmd__GetVideoSourceConfigurationOptions(struct soap *soap, struct _tmd__GetVideoSourceConfigurationOptions *tmd__GetVideoSourceConfigurationOptions, struct _tmd__GetVideoSourceConfigurationOptionsResponse *tmd__GetVideoSourceConfigurationOptionsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	tmd__GetVideoSourceConfigurationOptionsResponse->VideoSourceConfigurationOptions = (struct tt__VideoSourceConfigurationOptions *)soap_malloc(soap, sizeof(struct tt__VideoSourceConfigurationOptions)); 
	tmd__GetVideoSourceConfigurationOptionsResponse->__size = 0;
	tmd__GetVideoSourceConfigurationOptionsResponse->__any = NULL;
	get_vsconfig_options(soap, tmd__GetVideoSourceConfigurationOptions->VideoSourceToken,NULL,
			tmd__GetVideoSourceConfigurationOptionsResponse->VideoSourceConfigurationOptions);

	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetVideoOutputConfigurationOptions */
int __tmd__GetVideoOutputConfigurationOptions(struct soap *soap, struct _tmd__GetVideoOutputConfigurationOptions *tmd__GetVideoOutputConfigurationOptions, struct _tmd__GetVideoOutputConfigurationOptionsResponse *tmd__GetVideoOutputConfigurationOptionsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	tmd__GetVideoOutputConfigurationOptionsResponse->__size = 0;
	tmd__GetVideoOutputConfigurationOptionsResponse->__any = NULL;
	tmd__GetVideoOutputConfigurationOptionsResponse->VideoOutputConfigurationOptions = (struct tt__VideoOutputConfigurationOptions *)soap_malloc(soap, sizeof(struct tt__VideoOutputConfigurationOptions));
	get_voconfig_options(soap,tmd__GetVideoOutputConfigurationOptions->VideoOutputToken,
			tmd__GetVideoOutputConfigurationOptionsResponse->VideoOutputConfigurationOptions);

	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetAudioSourceConfigurationOptions */
int __tmd__GetAudioSourceConfigurationOptions(struct soap *soap, struct _tmd__GetAudioSourceConfigurationOptions *tmd__GetAudioSourceConfigurationOptions, struct _tmd__GetAudioSourceConfigurationOptionsResponse *tmd__GetAudioSourceConfigurationOptionsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	tmd__GetAudioSourceConfigurationOptionsResponse->__size = 0;
	tmd__GetAudioSourceConfigurationOptionsResponse->__any = NULL;
	tmd__GetAudioSourceConfigurationOptionsResponse->AudioSourceOptions = (struct tt__AudioSourceConfigurationOptions*)soap_malloc(soap, sizeof(struct tt__AudioSourceConfigurationOptions));
	get_asconfig_options(soap,tmd__GetAudioSourceConfigurationOptions->AudioSourceToken,NULL,
			tmd__GetAudioSourceConfigurationOptionsResponse->AudioSourceOptions);
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetAudioOutputConfigurationOptions */
int __tmd__GetAudioOutputConfigurationOptions(struct soap *soap, struct _tmd__GetAudioOutputConfigurationOptions *tmd__GetAudioOutputConfigurationOptions, struct _tmd__GetAudioOutputConfigurationOptionsResponse *tmd__GetAudioOutputConfigurationOptionsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	tmd__GetAudioOutputConfigurationOptionsResponse->__size = 0;
	tmd__GetAudioOutputConfigurationOptionsResponse->__any = NULL;
	tmd__GetAudioOutputConfigurationOptionsResponse->AudioOutputOptions = (struct tt__AudioOutputConfigurationOptions *)soap_malloc(soap, sizeof(struct tt__AudioOutputConfigurationOptions));
	get_aoconfig_options(soap, tmd__GetAudioOutputConfigurationOptions->AudioOutputToken,NULL,
			tmd__GetAudioOutputConfigurationOptionsResponse->AudioOutputOptions);
	return SOAP_OK;
}


/** Auto-test server operation __tmd__GetRelayOutputs */
int __tmd__GetRelayOutputs(struct soap *soap, struct _tds__GetRelayOutputs *tds__GetRelayOutputs, struct _tds__GetRelayOutputsResponse *tds__GetRelayOutputsResponse)
{	
	/* Return incomplete response with default data values */
	INFO(stderr);
	//unsupport relay output...
	//
	return SOAP_OK;
}


/** Auto-test server operation __tmd__SetRelayOutputSettings */
int __tmd__SetRelayOutputSettings(struct soap *soap, struct _tmd__SetRelayOutputSettings *tmd__SetRelayOutputSettings, struct _tmd__SetRelayOutputSettingsResponse *tmd__SetRelayOutputSettingsResponse)
{	
	INFO(stderr);
	//unsupport relay output...
	//
	return SOAP_OK;
}


/** Auto-test server operation __tmd__SetRelayOutputState */
int __tmd__SetRelayOutputState(struct soap *soap, struct _tds__SetRelayOutputState *tds__SetRelayOutputState, struct _tds__SetRelayOutputStateResponse *tds__SetRelayOutputStateResponse)
{	
	INFO(stderr);
	//unsupport relay output...
	//
	return SOAP_OK;
}


